<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="logging_v2.html">Cloud Logging API</a> . <a href="logging_v2.entries.html">entries</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#copy">copy(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Copies a set of log entries from a log bucket to a Cloud Storage bucket.</p>
<p class="toc_element">
  <code><a href="#list">list(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs (https://cloud.google.com/logging/docs/export).</p>
<p class="toc_element">
  <code><a href="#list_next">list_next()</a></code></p>
<p class="firstline">Retrieves the next page of results.</p>
<p class="toc_element">
  <code><a href="#tail">tail(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Streaming read of log entries as they are received. Until the stream is terminated, it will continue reading logs.</p>
<p class="toc_element">
  <code><a href="#write">write(body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resource names (projects, organizations, billing accounts or folders), where the resource name for a log entry is determined from its logName field.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="copy">copy(body=None, x__xgafv=None)</code>
  <pre>Copies a set of log entries from a log bucket to a Cloud Storage bucket.

Args:
  body: object, The request body.
    The object takes the form of:

{ # The parameters to CopyLogEntries.
  &quot;destination&quot;: &quot;A String&quot;, # Required. Destination to which to copy log entries. For example: &quot;storage.googleapis.com/GCS_BUCKET&quot;
  &quot;filter&quot;: &quot;A String&quot;, # Optional. A filter specifying which log entries to copy. The filter must be no more than 20k characters. An empty filter matches all log entries.
  &quot;name&quot;: &quot;A String&quot;, # Required. Log bucket from which to copy log entries.For example:&quot;projects/my-project/locations/global/buckets/my-source-bucket&quot;
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # This resource represents a long-running operation that is the result of a network API call.
  &quot;done&quot;: True or False, # If the value is false, it means the operation is still in progress. If true, the operation is completed, and either error or response is available.
  &quot;error&quot;: { # The Status type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by gRPC (https://github.com/grpc). Each Status message contains three pieces of data: error code, error message, and error details.You can find out more about this error model and how to work with it in the API Design Guide (https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
    &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
    &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
      },
    ],
    &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  },
  &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
    &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
  },
  &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the name should be a resource name ending with operations/{unique_id}.
  &quot;response&quot;: { # The normal, successful response of the operation. If the original method returns no data on success, such as Delete, the response is google.protobuf.Empty. If the original method is standard Get/Create/Update, the response should be the resource. For other methods, the response should have the type XxxResponse, where Xxx is the original method name. For example, if the original method name is TakeSnapshot(), the inferred response type is TakeSnapshotResponse.
    &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="list">list(body=None, x__xgafv=None)</code>
  <pre>Lists log entries. Use this method to retrieve log entries that originated from a project/folder/organization/billing account. For ways to export log entries, see Exporting Logs (https://cloud.google.com/logging/docs/export).

Args:
  body: object, The request body.
    The object takes the form of:

{ # The parameters to ListLogEntries.
  &quot;filter&quot;: &quot;A String&quot;, # Optional. A filter that chooses which log entries to return. For more information, see Logging query language (https://cloud.google.com/logging/docs/view/logging-query-language).Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter to return no results. The maximum length of a filter is 20,000 characters.To make queries faster, you can make the filter more selective by using restrictions on indexed fields (https://cloud.google.com/logging/docs/view/logging-query-language#indexed-fields) as well as limit the time range of the query by adding range restrictions on the timestamp field.
  &quot;orderBy&quot;: &quot;A String&quot;, # Optional. How the results should be sorted. Presently, the only permitted values are &quot;timestamp asc&quot; (default) and &quot;timestamp desc&quot;. The first option returns entries in order of increasing values of LogEntry.timestamp (oldest first), and the second option returns entries in order of decreasing timestamps (newest first). Entries with equal timestamps are returned in order of their insert_id values.We recommend setting the order_by field to &quot;timestamp desc&quot; when listing recently ingested log entries. If not set, the default value of &quot;timestamp asc&quot; may take a long time to fetch matching logs that are only recently ingested.
  &quot;pageSize&quot;: 42, # Optional. The maximum number of results to return from this request. Default is 50. If the value is negative, the request is rejected.The presence of next_page_token in the response indicates that more results might be available.
  &quot;pageToken&quot;: &quot;A String&quot;, # Optional. If present, then retrieve the next batch of results from the preceding call to this method. page_token must be the value of next_page_token from the previous response. The values of other method parameters should be identical to those in the previous call.
  &quot;projectIds&quot;: [ # Optional. Deprecated. Use resource_names instead. One or more project identifiers or project numbers from which to retrieve log entries. Example: &quot;my-project-1A&quot;.
    &quot;A String&quot;,
  ],
  &quot;resourceNames&quot;: [ # Required. Names of one or more parent resources from which to retrieve log entries. Resources may either be resource containers or specific LogViews. For the case of resource containers, all logs ingested into that container will be returned regardless of which LogBuckets they are actually stored in - i.e. these queries may fan out to multiple regions. In the event of region unavailability, specify a specific set of LogViews that do not include the unavailable region. projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID] projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]Projects listed in the project_ids field are added to this list. A maximum of 100 resources may be specified in a single request.
    &quot;A String&quot;,
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Result returned from ListLogEntries.
  &quot;entries&quot;: [ # A list of log entries. If entries is empty, nextPageToken may still be returned, indicating that more entries may exist. See nextPageToken for more information.
    { # An individual entry in a log.
      &quot;apphub&quot;: { # Metadata associated with App Hub. # Output only. AppHub application metadata associated with this LogEntry. May be empty if there is no associated AppHub application or multiple associated applications (such as for VPC flow logs)
        &quot;application&quot;: { # Resource identifiers associated with an AppHub application AppHub resources are of the form projects//locations//applications/ projects//locations//applications//services/ projects//locations//applications//workloads/ These resources can be reconstructed from the components below. # Metadata associated with the application.
          &quot;container&quot;: &quot;A String&quot;, # Resource container that owns the application. Example: &quot;projects/management_project&quot;
          &quot;id&quot;: &quot;A String&quot;, # Application Id. Example: &quot;my-app&quot;
          &quot;location&quot;: &quot;A String&quot;, # Location associated with the Application. Example: &quot;us-east1&quot;
        },
        &quot;service&quot;: { # Metadata associated with an App Hub service. # Metadata associated with the service.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Service criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Service environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Service Id. Example: &quot;my-service&quot;
        },
        &quot;workload&quot;: { # Metadata associated with an App Hub workload. # Metadata associated with the workload.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Workload criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Workload environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Workload Id. Example: &quot;my-workload&quot;
        },
      },
      &quot;apphubDestination&quot;: { # Metadata associated with App Hub. # Output only. AppHub application metadata associated with the destination application. This is only populated if the log represented &quot;edge&quot;-like data (such as for VPC flow logs) with a source and destination.
        &quot;application&quot;: { # Resource identifiers associated with an AppHub application AppHub resources are of the form projects//locations//applications/ projects//locations//applications//services/ projects//locations//applications//workloads/ These resources can be reconstructed from the components below. # Metadata associated with the application.
          &quot;container&quot;: &quot;A String&quot;, # Resource container that owns the application. Example: &quot;projects/management_project&quot;
          &quot;id&quot;: &quot;A String&quot;, # Application Id. Example: &quot;my-app&quot;
          &quot;location&quot;: &quot;A String&quot;, # Location associated with the Application. Example: &quot;us-east1&quot;
        },
        &quot;service&quot;: { # Metadata associated with an App Hub service. # Metadata associated with the service.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Service criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Service environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Service Id. Example: &quot;my-service&quot;
        },
        &quot;workload&quot;: { # Metadata associated with an App Hub workload. # Metadata associated with the workload.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Workload criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Workload environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Workload Id. Example: &quot;my-workload&quot;
        },
      },
      &quot;errorGroups&quot;: [ # Output only. The Error Reporting (https://cloud.google.com/error-reporting) error groups associated with this LogEntry. Error Reporting sets the values for this field during error group creation.For more information, see View error details( https://cloud.google.com/error-reporting/docs/viewing-errors#view_error_details)This field isn&#x27;t available during log routing (https://cloud.google.com/logging/docs/routing/overview)
        { # Contains metadata that associates the LogEntry to Error Reporting error groups.
          &quot;id&quot;: &quot;A String&quot;, # The id is a unique identifier for a particular error group; it is the last part of the error group resource name: /project/[PROJECT_ID]/errors/[ERROR_GROUP_ID]. Example: COShysOX0r_51QE. The id is derived from key parts of the error-log content and is treated as Service Data. For information about how Service Data is handled, see Google Cloud Privacy Notice (https://cloud.google.com/terms/cloud-privacy-notice).
        },
      ],
      &quot;httpRequest&quot;: { # A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message. # Optional. Information about the HTTP request associated with this log entry, if applicable.
        &quot;cacheFillBytes&quot;: &quot;A String&quot;, # The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.
        &quot;cacheHit&quot;: True or False, # Whether or not an entity was served from cache (with or without validation).
        &quot;cacheLookup&quot;: True or False, # Whether or not a cache lookup was attempted.
        &quot;cacheValidatedWithOriginServer&quot;: True or False, # Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.
        &quot;latency&quot;: &quot;A String&quot;, # The request processing latency on the server, from the time the request was received until the response was sent. For WebSocket connections, this field refers to the entire time duration of the connection.
        &quot;protocol&quot;: &quot;A String&quot;, # Protocol used for the request. Examples: &quot;HTTP/1.1&quot;, &quot;HTTP/2&quot;
        &quot;referer&quot;: &quot;A String&quot;, # The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
        &quot;remoteIp&quot;: &quot;A String&quot;, # The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: &quot;192.168.1.1&quot;, &quot;10.0.0.1:80&quot;, &quot;FE80::0202:B3FF:FE1E:8329&quot;.
        &quot;requestMethod&quot;: &quot;A String&quot;, # The request method. Examples: &quot;GET&quot;, &quot;HEAD&quot;, &quot;PUT&quot;, &quot;POST&quot;.
        &quot;requestSize&quot;: &quot;A String&quot;, # The size of the HTTP request message in bytes, including the request headers and the request body.
        &quot;requestUrl&quot;: &quot;A String&quot;, # The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: &quot;http://example.com/some/info?color=red&quot;.
        &quot;responseSize&quot;: &quot;A String&quot;, # The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.
        &quot;serverIp&quot;: &quot;A String&quot;, # The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: &quot;192.168.1.1&quot;, &quot;10.0.0.1:80&quot;, &quot;FE80::0202:B3FF:FE1E:8329&quot;.
        &quot;status&quot;: 42, # The response code indicating the status of response. Examples: 200, 404.
        &quot;userAgent&quot;: &quot;A String&quot;, # The user agent sent by the client. Example: &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)&quot;.
      },
      &quot;insertId&quot;: &quot;A String&quot;, # Optional. A unique identifier for the log entry. If you provide a value, then Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which are removed in a single query result. However, there are no guarantees of de-duplication in the export of logs.If the insert_id is omitted when writing a log entry, the Logging API assigns its own unique identifier in this field.In queries, the insert_id is also used to order log entries that have the same log_name and timestamp values.
      &quot;jsonPayload&quot;: { # The log entry payload, represented as a structure that is expressed as a JSON object.
        &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
      },
      &quot;labels&quot;: { # Optional. A map of key, value pairs that provides additional information about the log entry. The labels can be user-defined or system-defined.User-defined labels are arbitrary key, value pairs that you can use to classify logs.System-defined labels are defined by GCP services for platform logs. They have two components - a service namespace component and the attribute name. For example: compute.googleapis.com/resource_name.Cloud Logging truncates label keys that exceed 512 B and label values that exceed 64 KB upon their associated log entry being written. The truncation is indicated by an ellipsis at the end of the character string.
        &quot;a_key&quot;: &quot;A String&quot;,
      },
      &quot;logName&quot;: &quot;A String&quot;, # Required. The resource name of the log to which this log entry belongs: &quot;projects/[PROJECT_ID]/logs/[LOG_ID]&quot; &quot;organizations/[ORGANIZATION_ID]/logs/[LOG_ID]&quot; &quot;billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]&quot; &quot;folders/[FOLDER_ID]/logs/[LOG_ID]&quot; A project number may be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.[LOG_ID] must be URL-encoded within log_name. Example: &quot;organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity&quot;.[LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period.For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is processed as usual, but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results.
      &quot;metadata&quot;: { # Auxiliary metadata for a MonitoredResource object. MonitoredResource objects contain the minimum set of information to uniquely identify a monitored resource instance. There is some other useful auxiliary metadata. Monitoring and Logging use an ingestion pipeline to extract metadata for cloud resources of all types, and store the metadata in this message. # Output only. Deprecated. This field is not used by Logging. Any value written to it is cleared.
        &quot;systemLabels&quot;: { # Output only. Values for predefined system metadata labels. System labels are a kind of metadata extracted by Google, including &quot;machine_image&quot;, &quot;vpc&quot;, &quot;subnet_id&quot;, &quot;security_group&quot;, &quot;name&quot;, etc. System label values can be only strings, Boolean values, or a list of strings. For example: { &quot;name&quot;: &quot;my-test-instance&quot;, &quot;security_group&quot;: [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;], &quot;spot_instance&quot;: false }
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
        &quot;userLabels&quot;: { # Output only. A map of user-defined metadata labels.
          &quot;a_key&quot;: &quot;A String&quot;,
        },
      },
      &quot;operation&quot;: { # Additional information about a potentially long-running operation with which a log entry is associated. # Optional. Information about an operation associated with the log entry, if applicable.
        &quot;first&quot;: True or False, # Optional. Set this to True if this is the first log entry in the operation.
        &quot;id&quot;: &quot;A String&quot;, # Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation.
        &quot;last&quot;: True or False, # Optional. Set this to True if this is the last log entry in the operation.
        &quot;producer&quot;: &quot;A String&quot;, # Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: &quot;MyDivision.MyBigCompany.com&quot;, &quot;github.com/MyProject/MyApplication&quot;.
      },
      &quot;protoPayload&quot;: { # The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.The following protocol buffer types are supported; user-defined types are not supported:&quot;type.googleapis.com/google.cloud.audit.AuditLog&quot; &quot;type.googleapis.com/google.appengine.logging.v1.RequestLog&quot;
        &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
      },
      &quot;receiveTimestamp&quot;: &quot;A String&quot;, # Output only. The time the log entry was received by Logging.
      &quot;resource&quot;: { # An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource&#x27;s schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for &quot;gce_instance&quot; has labels &quot;project_id&quot;, &quot;instance_id&quot; and &quot;zone&quot;: { &quot;type&quot;: &quot;gce_instance&quot;, &quot;labels&quot;: { &quot;project_id&quot;: &quot;my-project&quot;, &quot;instance_id&quot;: &quot;12345678901234&quot;, &quot;zone&quot;: &quot;us-central1-a&quot; }} # Required. The monitored resource that produced this log entry.Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error.
        &quot;labels&quot;: { # Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels &quot;project_id&quot;, &quot;instance_id&quot;, and &quot;zone&quot;.
          &quot;a_key&quot;: &quot;A String&quot;,
        },
        &quot;type&quot;: &quot;A String&quot;, # Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance. Some descriptors include the service name in the type; for example, the type of a Datastream stream is datastream.googleapis.com/Stream.
      },
      &quot;severity&quot;: &quot;A String&quot;, # Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.
      &quot;sourceLocation&quot;: { # Additional information about the source code location that produced the log entry. # Optional. Source code location information associated with the log entry, if any.
        &quot;file&quot;: &quot;A String&quot;, # Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.
        &quot;function&quot;: &quot;A String&quot;, # Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python).
        &quot;line&quot;: &quot;A String&quot;, # Optional. Line within the source file. 1-based; 0 indicates no line number available.
      },
      &quot;spanId&quot;: &quot;A String&quot;, # Optional. The ID of the Cloud Trace (https://cloud.google.com/trace) span associated with the current operation in which the log is being written. For example, if a span has the REST resource name of &quot;projects/some-project/traces/some-trace/spans/some-span-id&quot;, then the span_id field is &quot;some-span-id&quot;.A Span (https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) represents a single operation within a trace. Whereas a trace may involve multiple different microservices running on multiple different machines, a span generally corresponds to a single logical operation being performed in a single instance of a microservice on one specific machine. Spans are the nodes within the tree that is a trace.Applications that are instrumented for tracing (https://cloud.google.com/trace/docs/setup) will generally assign a new, unique span ID on each incoming request. It is also common to create and record additional spans corresponding to internal processing elements as well as issuing requests to dependencies.The span ID is expected to be a 16-character, hexadecimal encoding of an 8-byte array and should not be zero. It should be unique within the trace and should, ideally, be generated in a manner that is uniformly random.Example values: 000000000000004a 7a2190356c3fc94b 0000f00300090021 d39223e101960076
      &quot;split&quot;: { # Additional information used to correlate multiple log entries. Used when a single LogEntry would exceed the Google Cloud Logging size limit and is split across multiple log entries. # Optional. Information indicating this LogEntry is part of a sequence of multiple log entries split from a single LogEntry.
        &quot;index&quot;: 42, # The index of this LogEntry in the sequence of split log entries. Log entries are given |index| values 0, 1, ..., n-1 for a sequence of n log entries.
        &quot;totalSplits&quot;: 42, # The total number of log entries that the original LogEntry was split into.
        &quot;uid&quot;: &quot;A String&quot;, # A globally unique identifier for all log entries in a sequence of split log entries. All log entries with the same |LogSplit.uid| are assumed to be part of the same sequence of split log entries.
      },
      &quot;textPayload&quot;: &quot;A String&quot;, # The log entry payload, represented as a Unicode string (UTF-8).
      &quot;timestamp&quot;: &quot;A String&quot;, # Optional. The time the event described by the log entry occurred. This time is used to compute the log entry&#x27;s age and to enforce the logs retention period. If this field is omitted in a new log entry, then Logging assigns it the current time. Timestamps have nanosecond accuracy, but trailing zeros in the fractional seconds might be omitted when the timestamp is displayed.Incoming log entries must have timestamps that don&#x27;t exceed the logs retention period (https://cloud.google.com/logging/quotas#logs_retention_periods) in the past, and that don&#x27;t exceed 24 hours in the future. Log entries outside those time boundaries are rejected by Logging.
      &quot;trace&quot;: &quot;A String&quot;, # Optional. The REST resource name of the trace being written to Cloud Trace (https://cloud.google.com/trace) in association with this log entry. For example, if your trace data is stored in the Cloud project &quot;my-trace-project&quot; and if the service that is creating the log entry receives a trace header that includes the trace ID &quot;12345&quot;, then the service should use &quot;projects/my-trace-project/traces/12345&quot;.The trace field provides the link between logs and traces. By using this field, you can navigate from a log entry to a trace.
      &quot;traceSampled&quot;: True or False, # Optional. The sampling decision of the span associated with the log entry at the time the log entry was created. This field corresponds to the sampled flag in the W3C trace-context specification (https://www.w3.org/TR/trace-context/#sampled-flag). A non-sampled trace value is still useful as a request correlation identifier. The default is False.
    },
  ],
  &quot;nextPageToken&quot;: &quot;A String&quot;, # If there might be more results than those appearing in this response, then nextPageToken is included. To get the next set of results, call this method again using the value of nextPageToken as pageToken.If a value for next_page_token appears and the entries field is empty, it means that the search found no log entries so far but it did not have time to search all the possible log entries. Retry the method with this value for page_token to continue the search. Alternatively, consider speeding up the search by changing your filter to specify a single log name or resource type, or to narrow the time range of the search.
}</pre>
</div>

<div class="method">
    <code class="details" id="list_next">list_next()</code>
  <pre>Retrieves the next page of results.

        Args:
          previous_request: The request for the previous page. (required)
          previous_response: The response from the request for the previous page. (required)

        Returns:
          A request object that you can call &#x27;execute()&#x27; on to request the next
          page. Returns None if there are no more items in the collection.
        </pre>
</div>

<div class="method">
    <code class="details" id="tail">tail(body=None, x__xgafv=None)</code>
  <pre>Streaming read of log entries as they are received. Until the stream is terminated, it will continue reading logs.

Args:
  body: object, The request body.
    The object takes the form of:

{ # The parameters to TailLogEntries.
  &quot;bufferWindow&quot;: &quot;A String&quot;, # Optional. The amount of time to buffer log entries at the server before being returned to prevent out of order results due to late arriving log entries. Valid values are between 0-60000 milliseconds. Defaults to 2000 milliseconds.
  &quot;filter&quot;: &quot;A String&quot;, # Optional. Only log entries that match the filter are returned. An empty filter matches all log entries in the resources listed in resource_names. Referencing a parent resource that is not listed in resource_names will cause the filter to return no results. The maximum length of a filter is 20,000 characters.
  &quot;resourceNames&quot;: [ # Required. Name of a parent resource from which to retrieve log entries: projects/[PROJECT_ID] organizations/[ORGANIZATION_ID] billingAccounts/[BILLING_ACCOUNT_ID] folders/[FOLDER_ID]May alternatively be one or more views: projects/[PROJECT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] organizations/[ORGANIZATION_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] billingAccounts/[BILLING_ACCOUNT_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID] folders/[FOLDER_ID]/locations/[LOCATION_ID]/buckets/[BUCKET_ID]/views/[VIEW_ID]
    &quot;A String&quot;,
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Result returned from TailLogEntries.
  &quot;entries&quot;: [ # A list of log entries. Each response in the stream will order entries with increasing values of LogEntry.timestamp. Ordering is not guaranteed between separate responses.
    { # An individual entry in a log.
      &quot;apphub&quot;: { # Metadata associated with App Hub. # Output only. AppHub application metadata associated with this LogEntry. May be empty if there is no associated AppHub application or multiple associated applications (such as for VPC flow logs)
        &quot;application&quot;: { # Resource identifiers associated with an AppHub application AppHub resources are of the form projects//locations//applications/ projects//locations//applications//services/ projects//locations//applications//workloads/ These resources can be reconstructed from the components below. # Metadata associated with the application.
          &quot;container&quot;: &quot;A String&quot;, # Resource container that owns the application. Example: &quot;projects/management_project&quot;
          &quot;id&quot;: &quot;A String&quot;, # Application Id. Example: &quot;my-app&quot;
          &quot;location&quot;: &quot;A String&quot;, # Location associated with the Application. Example: &quot;us-east1&quot;
        },
        &quot;service&quot;: { # Metadata associated with an App Hub service. # Metadata associated with the service.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Service criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Service environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Service Id. Example: &quot;my-service&quot;
        },
        &quot;workload&quot;: { # Metadata associated with an App Hub workload. # Metadata associated with the workload.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Workload criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Workload environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Workload Id. Example: &quot;my-workload&quot;
        },
      },
      &quot;apphubDestination&quot;: { # Metadata associated with App Hub. # Output only. AppHub application metadata associated with the destination application. This is only populated if the log represented &quot;edge&quot;-like data (such as for VPC flow logs) with a source and destination.
        &quot;application&quot;: { # Resource identifiers associated with an AppHub application AppHub resources are of the form projects//locations//applications/ projects//locations//applications//services/ projects//locations//applications//workloads/ These resources can be reconstructed from the components below. # Metadata associated with the application.
          &quot;container&quot;: &quot;A String&quot;, # Resource container that owns the application. Example: &quot;projects/management_project&quot;
          &quot;id&quot;: &quot;A String&quot;, # Application Id. Example: &quot;my-app&quot;
          &quot;location&quot;: &quot;A String&quot;, # Location associated with the Application. Example: &quot;us-east1&quot;
        },
        &quot;service&quot;: { # Metadata associated with an App Hub service. # Metadata associated with the service.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Service criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Service environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Service Id. Example: &quot;my-service&quot;
        },
        &quot;workload&quot;: { # Metadata associated with an App Hub workload. # Metadata associated with the workload.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Workload criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Workload environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Workload Id. Example: &quot;my-workload&quot;
        },
      },
      &quot;errorGroups&quot;: [ # Output only. The Error Reporting (https://cloud.google.com/error-reporting) error groups associated with this LogEntry. Error Reporting sets the values for this field during error group creation.For more information, see View error details( https://cloud.google.com/error-reporting/docs/viewing-errors#view_error_details)This field isn&#x27;t available during log routing (https://cloud.google.com/logging/docs/routing/overview)
        { # Contains metadata that associates the LogEntry to Error Reporting error groups.
          &quot;id&quot;: &quot;A String&quot;, # The id is a unique identifier for a particular error group; it is the last part of the error group resource name: /project/[PROJECT_ID]/errors/[ERROR_GROUP_ID]. Example: COShysOX0r_51QE. The id is derived from key parts of the error-log content and is treated as Service Data. For information about how Service Data is handled, see Google Cloud Privacy Notice (https://cloud.google.com/terms/cloud-privacy-notice).
        },
      ],
      &quot;httpRequest&quot;: { # A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message. # Optional. Information about the HTTP request associated with this log entry, if applicable.
        &quot;cacheFillBytes&quot;: &quot;A String&quot;, # The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.
        &quot;cacheHit&quot;: True or False, # Whether or not an entity was served from cache (with or without validation).
        &quot;cacheLookup&quot;: True or False, # Whether or not a cache lookup was attempted.
        &quot;cacheValidatedWithOriginServer&quot;: True or False, # Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.
        &quot;latency&quot;: &quot;A String&quot;, # The request processing latency on the server, from the time the request was received until the response was sent. For WebSocket connections, this field refers to the entire time duration of the connection.
        &quot;protocol&quot;: &quot;A String&quot;, # Protocol used for the request. Examples: &quot;HTTP/1.1&quot;, &quot;HTTP/2&quot;
        &quot;referer&quot;: &quot;A String&quot;, # The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
        &quot;remoteIp&quot;: &quot;A String&quot;, # The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: &quot;192.168.1.1&quot;, &quot;10.0.0.1:80&quot;, &quot;FE80::0202:B3FF:FE1E:8329&quot;.
        &quot;requestMethod&quot;: &quot;A String&quot;, # The request method. Examples: &quot;GET&quot;, &quot;HEAD&quot;, &quot;PUT&quot;, &quot;POST&quot;.
        &quot;requestSize&quot;: &quot;A String&quot;, # The size of the HTTP request message in bytes, including the request headers and the request body.
        &quot;requestUrl&quot;: &quot;A String&quot;, # The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: &quot;http://example.com/some/info?color=red&quot;.
        &quot;responseSize&quot;: &quot;A String&quot;, # The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.
        &quot;serverIp&quot;: &quot;A String&quot;, # The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: &quot;192.168.1.1&quot;, &quot;10.0.0.1:80&quot;, &quot;FE80::0202:B3FF:FE1E:8329&quot;.
        &quot;status&quot;: 42, # The response code indicating the status of response. Examples: 200, 404.
        &quot;userAgent&quot;: &quot;A String&quot;, # The user agent sent by the client. Example: &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)&quot;.
      },
      &quot;insertId&quot;: &quot;A String&quot;, # Optional. A unique identifier for the log entry. If you provide a value, then Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which are removed in a single query result. However, there are no guarantees of de-duplication in the export of logs.If the insert_id is omitted when writing a log entry, the Logging API assigns its own unique identifier in this field.In queries, the insert_id is also used to order log entries that have the same log_name and timestamp values.
      &quot;jsonPayload&quot;: { # The log entry payload, represented as a structure that is expressed as a JSON object.
        &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
      },
      &quot;labels&quot;: { # Optional. A map of key, value pairs that provides additional information about the log entry. The labels can be user-defined or system-defined.User-defined labels are arbitrary key, value pairs that you can use to classify logs.System-defined labels are defined by GCP services for platform logs. They have two components - a service namespace component and the attribute name. For example: compute.googleapis.com/resource_name.Cloud Logging truncates label keys that exceed 512 B and label values that exceed 64 KB upon their associated log entry being written. The truncation is indicated by an ellipsis at the end of the character string.
        &quot;a_key&quot;: &quot;A String&quot;,
      },
      &quot;logName&quot;: &quot;A String&quot;, # Required. The resource name of the log to which this log entry belongs: &quot;projects/[PROJECT_ID]/logs/[LOG_ID]&quot; &quot;organizations/[ORGANIZATION_ID]/logs/[LOG_ID]&quot; &quot;billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]&quot; &quot;folders/[FOLDER_ID]/logs/[LOG_ID]&quot; A project number may be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.[LOG_ID] must be URL-encoded within log_name. Example: &quot;organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity&quot;.[LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period.For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is processed as usual, but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results.
      &quot;metadata&quot;: { # Auxiliary metadata for a MonitoredResource object. MonitoredResource objects contain the minimum set of information to uniquely identify a monitored resource instance. There is some other useful auxiliary metadata. Monitoring and Logging use an ingestion pipeline to extract metadata for cloud resources of all types, and store the metadata in this message. # Output only. Deprecated. This field is not used by Logging. Any value written to it is cleared.
        &quot;systemLabels&quot;: { # Output only. Values for predefined system metadata labels. System labels are a kind of metadata extracted by Google, including &quot;machine_image&quot;, &quot;vpc&quot;, &quot;subnet_id&quot;, &quot;security_group&quot;, &quot;name&quot;, etc. System label values can be only strings, Boolean values, or a list of strings. For example: { &quot;name&quot;: &quot;my-test-instance&quot;, &quot;security_group&quot;: [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;], &quot;spot_instance&quot;: false }
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
        &quot;userLabels&quot;: { # Output only. A map of user-defined metadata labels.
          &quot;a_key&quot;: &quot;A String&quot;,
        },
      },
      &quot;operation&quot;: { # Additional information about a potentially long-running operation with which a log entry is associated. # Optional. Information about an operation associated with the log entry, if applicable.
        &quot;first&quot;: True or False, # Optional. Set this to True if this is the first log entry in the operation.
        &quot;id&quot;: &quot;A String&quot;, # Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation.
        &quot;last&quot;: True or False, # Optional. Set this to True if this is the last log entry in the operation.
        &quot;producer&quot;: &quot;A String&quot;, # Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: &quot;MyDivision.MyBigCompany.com&quot;, &quot;github.com/MyProject/MyApplication&quot;.
      },
      &quot;protoPayload&quot;: { # The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.The following protocol buffer types are supported; user-defined types are not supported:&quot;type.googleapis.com/google.cloud.audit.AuditLog&quot; &quot;type.googleapis.com/google.appengine.logging.v1.RequestLog&quot;
        &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
      },
      &quot;receiveTimestamp&quot;: &quot;A String&quot;, # Output only. The time the log entry was received by Logging.
      &quot;resource&quot;: { # An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource&#x27;s schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for &quot;gce_instance&quot; has labels &quot;project_id&quot;, &quot;instance_id&quot; and &quot;zone&quot;: { &quot;type&quot;: &quot;gce_instance&quot;, &quot;labels&quot;: { &quot;project_id&quot;: &quot;my-project&quot;, &quot;instance_id&quot;: &quot;12345678901234&quot;, &quot;zone&quot;: &quot;us-central1-a&quot; }} # Required. The monitored resource that produced this log entry.Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error.
        &quot;labels&quot;: { # Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels &quot;project_id&quot;, &quot;instance_id&quot;, and &quot;zone&quot;.
          &quot;a_key&quot;: &quot;A String&quot;,
        },
        &quot;type&quot;: &quot;A String&quot;, # Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance. Some descriptors include the service name in the type; for example, the type of a Datastream stream is datastream.googleapis.com/Stream.
      },
      &quot;severity&quot;: &quot;A String&quot;, # Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.
      &quot;sourceLocation&quot;: { # Additional information about the source code location that produced the log entry. # Optional. Source code location information associated with the log entry, if any.
        &quot;file&quot;: &quot;A String&quot;, # Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.
        &quot;function&quot;: &quot;A String&quot;, # Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python).
        &quot;line&quot;: &quot;A String&quot;, # Optional. Line within the source file. 1-based; 0 indicates no line number available.
      },
      &quot;spanId&quot;: &quot;A String&quot;, # Optional. The ID of the Cloud Trace (https://cloud.google.com/trace) span associated with the current operation in which the log is being written. For example, if a span has the REST resource name of &quot;projects/some-project/traces/some-trace/spans/some-span-id&quot;, then the span_id field is &quot;some-span-id&quot;.A Span (https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) represents a single operation within a trace. Whereas a trace may involve multiple different microservices running on multiple different machines, a span generally corresponds to a single logical operation being performed in a single instance of a microservice on one specific machine. Spans are the nodes within the tree that is a trace.Applications that are instrumented for tracing (https://cloud.google.com/trace/docs/setup) will generally assign a new, unique span ID on each incoming request. It is also common to create and record additional spans corresponding to internal processing elements as well as issuing requests to dependencies.The span ID is expected to be a 16-character, hexadecimal encoding of an 8-byte array and should not be zero. It should be unique within the trace and should, ideally, be generated in a manner that is uniformly random.Example values: 000000000000004a 7a2190356c3fc94b 0000f00300090021 d39223e101960076
      &quot;split&quot;: { # Additional information used to correlate multiple log entries. Used when a single LogEntry would exceed the Google Cloud Logging size limit and is split across multiple log entries. # Optional. Information indicating this LogEntry is part of a sequence of multiple log entries split from a single LogEntry.
        &quot;index&quot;: 42, # The index of this LogEntry in the sequence of split log entries. Log entries are given |index| values 0, 1, ..., n-1 for a sequence of n log entries.
        &quot;totalSplits&quot;: 42, # The total number of log entries that the original LogEntry was split into.
        &quot;uid&quot;: &quot;A String&quot;, # A globally unique identifier for all log entries in a sequence of split log entries. All log entries with the same |LogSplit.uid| are assumed to be part of the same sequence of split log entries.
      },
      &quot;textPayload&quot;: &quot;A String&quot;, # The log entry payload, represented as a Unicode string (UTF-8).
      &quot;timestamp&quot;: &quot;A String&quot;, # Optional. The time the event described by the log entry occurred. This time is used to compute the log entry&#x27;s age and to enforce the logs retention period. If this field is omitted in a new log entry, then Logging assigns it the current time. Timestamps have nanosecond accuracy, but trailing zeros in the fractional seconds might be omitted when the timestamp is displayed.Incoming log entries must have timestamps that don&#x27;t exceed the logs retention period (https://cloud.google.com/logging/quotas#logs_retention_periods) in the past, and that don&#x27;t exceed 24 hours in the future. Log entries outside those time boundaries are rejected by Logging.
      &quot;trace&quot;: &quot;A String&quot;, # Optional. The REST resource name of the trace being written to Cloud Trace (https://cloud.google.com/trace) in association with this log entry. For example, if your trace data is stored in the Cloud project &quot;my-trace-project&quot; and if the service that is creating the log entry receives a trace header that includes the trace ID &quot;12345&quot;, then the service should use &quot;projects/my-trace-project/traces/12345&quot;.The trace field provides the link between logs and traces. By using this field, you can navigate from a log entry to a trace.
      &quot;traceSampled&quot;: True or False, # Optional. The sampling decision of the span associated with the log entry at the time the log entry was created. This field corresponds to the sampled flag in the W3C trace-context specification (https://www.w3.org/TR/trace-context/#sampled-flag). A non-sampled trace value is still useful as a request correlation identifier. The default is False.
    },
  ],
  &quot;suppressionInfo&quot;: [ # If entries that otherwise would have been included in the session were not sent back to the client, counts of relevant entries omitted from the session with the reason that they were not included. There will be at most one of each reason per response. The counts represent the number of suppressed entries since the last streamed response.
    { # Information about entries that were omitted from the session.
      &quot;reason&quot;: &quot;A String&quot;, # The reason that entries were omitted from the session.
      &quot;suppressedCount&quot;: 42, # A lower bound on the count of entries omitted due to reason.
    },
  ],
}</pre>
</div>

<div class="method">
    <code class="details" id="write">write(body=None, x__xgafv=None)</code>
  <pre>Writes log entries to Logging. This API method is the only way to send log entries to Logging. This method is used, directly or indirectly, by the Logging agent (fluentd) and all logging libraries configured to use Logging. A single request may contain log entries for a maximum of 1000 different resource names (projects, organizations, billing accounts or folders), where the resource name for a log entry is determined from its logName field.

Args:
  body: object, The request body.
    The object takes the form of:

{ # The parameters to WriteLogEntries.
  &quot;dryRun&quot;: True or False, # Optional. If true, the request should expect normal response, but the entries won&#x27;t be persisted nor exported. Useful for checking whether the logging API endpoints are working properly before sending valuable data.
  &quot;entries&quot;: [ # Required. The log entries to send to Logging. The order of log entries in this list does not matter. Values supplied in this method&#x27;s log_name, resource, and labels fields are copied into those log entries in this list that do not include values for their corresponding fields. For more information, see the LogEntry type.If the timestamp or insert_id fields are missing in log entries, then this method supplies the current time or a unique identifier, respectively. The supplied values are chosen so that, among the log entries that did not supply their own values, the entries earlier in the list will sort before the entries later in the list. See the entries.list method.Log entries with timestamps that are more than the logs retention period (https://cloud.google.com/logging/quotas) in the past or more than 24 hours in the future will not be available when calling entries.list. However, those log entries can still be exported with LogSinks (https://cloud.google.com/logging/docs/api/tasks/exporting-logs).To improve throughput and to avoid exceeding the quota limit (https://cloud.google.com/logging/quotas) for calls to entries.write, you should try to include several log entries in this list, rather than calling this method for each individual log entry.
    { # An individual entry in a log.
      &quot;apphub&quot;: { # Metadata associated with App Hub. # Output only. AppHub application metadata associated with this LogEntry. May be empty if there is no associated AppHub application or multiple associated applications (such as for VPC flow logs)
        &quot;application&quot;: { # Resource identifiers associated with an AppHub application AppHub resources are of the form projects//locations//applications/ projects//locations//applications//services/ projects//locations//applications//workloads/ These resources can be reconstructed from the components below. # Metadata associated with the application.
          &quot;container&quot;: &quot;A String&quot;, # Resource container that owns the application. Example: &quot;projects/management_project&quot;
          &quot;id&quot;: &quot;A String&quot;, # Application Id. Example: &quot;my-app&quot;
          &quot;location&quot;: &quot;A String&quot;, # Location associated with the Application. Example: &quot;us-east1&quot;
        },
        &quot;service&quot;: { # Metadata associated with an App Hub service. # Metadata associated with the service.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Service criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Service environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Service Id. Example: &quot;my-service&quot;
        },
        &quot;workload&quot;: { # Metadata associated with an App Hub workload. # Metadata associated with the workload.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Workload criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Workload environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Workload Id. Example: &quot;my-workload&quot;
        },
      },
      &quot;apphubDestination&quot;: { # Metadata associated with App Hub. # Output only. AppHub application metadata associated with the destination application. This is only populated if the log represented &quot;edge&quot;-like data (such as for VPC flow logs) with a source and destination.
        &quot;application&quot;: { # Resource identifiers associated with an AppHub application AppHub resources are of the form projects//locations//applications/ projects//locations//applications//services/ projects//locations//applications//workloads/ These resources can be reconstructed from the components below. # Metadata associated with the application.
          &quot;container&quot;: &quot;A String&quot;, # Resource container that owns the application. Example: &quot;projects/management_project&quot;
          &quot;id&quot;: &quot;A String&quot;, # Application Id. Example: &quot;my-app&quot;
          &quot;location&quot;: &quot;A String&quot;, # Location associated with the Application. Example: &quot;us-east1&quot;
        },
        &quot;service&quot;: { # Metadata associated with an App Hub service. # Metadata associated with the service.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Service criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Service environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Service Id. Example: &quot;my-service&quot;
        },
        &quot;workload&quot;: { # Metadata associated with an App Hub workload. # Metadata associated with the workload.
          &quot;criticalityType&quot;: &quot;A String&quot;, # Workload criticality type Example: &quot;CRITICAL&quot;
          &quot;environmentType&quot;: &quot;A String&quot;, # Workload environment type Example: &quot;DEV&quot;
          &quot;id&quot;: &quot;A String&quot;, # Workload Id. Example: &quot;my-workload&quot;
        },
      },
      &quot;errorGroups&quot;: [ # Output only. The Error Reporting (https://cloud.google.com/error-reporting) error groups associated with this LogEntry. Error Reporting sets the values for this field during error group creation.For more information, see View error details( https://cloud.google.com/error-reporting/docs/viewing-errors#view_error_details)This field isn&#x27;t available during log routing (https://cloud.google.com/logging/docs/routing/overview)
        { # Contains metadata that associates the LogEntry to Error Reporting error groups.
          &quot;id&quot;: &quot;A String&quot;, # The id is a unique identifier for a particular error group; it is the last part of the error group resource name: /project/[PROJECT_ID]/errors/[ERROR_GROUP_ID]. Example: COShysOX0r_51QE. The id is derived from key parts of the error-log content and is treated as Service Data. For information about how Service Data is handled, see Google Cloud Privacy Notice (https://cloud.google.com/terms/cloud-privacy-notice).
        },
      ],
      &quot;httpRequest&quot;: { # A common proto for logging HTTP requests. Only contains semantics defined by the HTTP specification. Product-specific logging information MUST be defined in a separate message. # Optional. Information about the HTTP request associated with this log entry, if applicable.
        &quot;cacheFillBytes&quot;: &quot;A String&quot;, # The number of HTTP response bytes inserted into cache. Set only when a cache fill was attempted.
        &quot;cacheHit&quot;: True or False, # Whether or not an entity was served from cache (with or without validation).
        &quot;cacheLookup&quot;: True or False, # Whether or not a cache lookup was attempted.
        &quot;cacheValidatedWithOriginServer&quot;: True or False, # Whether or not the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is True.
        &quot;latency&quot;: &quot;A String&quot;, # The request processing latency on the server, from the time the request was received until the response was sent. For WebSocket connections, this field refers to the entire time duration of the connection.
        &quot;protocol&quot;: &quot;A String&quot;, # Protocol used for the request. Examples: &quot;HTTP/1.1&quot;, &quot;HTTP/2&quot;
        &quot;referer&quot;: &quot;A String&quot;, # The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions (https://datatracker.ietf.org/doc/html/rfc2616#section-14.36).
        &quot;remoteIp&quot;: &quot;A String&quot;, # The IP address (IPv4 or IPv6) of the client that issued the HTTP request. This field can include port information. Examples: &quot;192.168.1.1&quot;, &quot;10.0.0.1:80&quot;, &quot;FE80::0202:B3FF:FE1E:8329&quot;.
        &quot;requestMethod&quot;: &quot;A String&quot;, # The request method. Examples: &quot;GET&quot;, &quot;HEAD&quot;, &quot;PUT&quot;, &quot;POST&quot;.
        &quot;requestSize&quot;: &quot;A String&quot;, # The size of the HTTP request message in bytes, including the request headers and the request body.
        &quot;requestUrl&quot;: &quot;A String&quot;, # The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: &quot;http://example.com/some/info?color=red&quot;.
        &quot;responseSize&quot;: &quot;A String&quot;, # The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body.
        &quot;serverIp&quot;: &quot;A String&quot;, # The IP address (IPv4 or IPv6) of the origin server that the request was sent to. This field can include port information. Examples: &quot;192.168.1.1&quot;, &quot;10.0.0.1:80&quot;, &quot;FE80::0202:B3FF:FE1E:8329&quot;.
        &quot;status&quot;: 42, # The response code indicating the status of response. Examples: 200, 404.
        &quot;userAgent&quot;: &quot;A String&quot;, # The user agent sent by the client. Example: &quot;Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)&quot;.
      },
      &quot;insertId&quot;: &quot;A String&quot;, # Optional. A unique identifier for the log entry. If you provide a value, then Logging considers other log entries in the same project, with the same timestamp, and with the same insert_id to be duplicates which are removed in a single query result. However, there are no guarantees of de-duplication in the export of logs.If the insert_id is omitted when writing a log entry, the Logging API assigns its own unique identifier in this field.In queries, the insert_id is also used to order log entries that have the same log_name and timestamp values.
      &quot;jsonPayload&quot;: { # The log entry payload, represented as a structure that is expressed as a JSON object.
        &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
      },
      &quot;labels&quot;: { # Optional. A map of key, value pairs that provides additional information about the log entry. The labels can be user-defined or system-defined.User-defined labels are arbitrary key, value pairs that you can use to classify logs.System-defined labels are defined by GCP services for platform logs. They have two components - a service namespace component and the attribute name. For example: compute.googleapis.com/resource_name.Cloud Logging truncates label keys that exceed 512 B and label values that exceed 64 KB upon their associated log entry being written. The truncation is indicated by an ellipsis at the end of the character string.
        &quot;a_key&quot;: &quot;A String&quot;,
      },
      &quot;logName&quot;: &quot;A String&quot;, # Required. The resource name of the log to which this log entry belongs: &quot;projects/[PROJECT_ID]/logs/[LOG_ID]&quot; &quot;organizations/[ORGANIZATION_ID]/logs/[LOG_ID]&quot; &quot;billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID]&quot; &quot;folders/[FOLDER_ID]/logs/[LOG_ID]&quot; A project number may be used in place of PROJECT_ID. The project number is translated to its corresponding PROJECT_ID internally and the log_name field will contain PROJECT_ID in queries and exports.[LOG_ID] must be URL-encoded within log_name. Example: &quot;organizations/1234567890/logs/cloudresourcemanager.googleapis.com%2Factivity&quot;.[LOG_ID] must be less than 512 characters long and can only include the following characters: upper and lower case alphanumeric characters, forward-slash, underscore, hyphen, and period.For backward compatibility, if log_name begins with a forward-slash, such as /projects/..., then the log entry is processed as usual, but the forward-slash is removed. Listing the log entry will not show the leading slash and filtering for a log name with a leading slash will never return any results.
      &quot;metadata&quot;: { # Auxiliary metadata for a MonitoredResource object. MonitoredResource objects contain the minimum set of information to uniquely identify a monitored resource instance. There is some other useful auxiliary metadata. Monitoring and Logging use an ingestion pipeline to extract metadata for cloud resources of all types, and store the metadata in this message. # Output only. Deprecated. This field is not used by Logging. Any value written to it is cleared.
        &quot;systemLabels&quot;: { # Output only. Values for predefined system metadata labels. System labels are a kind of metadata extracted by Google, including &quot;machine_image&quot;, &quot;vpc&quot;, &quot;subnet_id&quot;, &quot;security_group&quot;, &quot;name&quot;, etc. System label values can be only strings, Boolean values, or a list of strings. For example: { &quot;name&quot;: &quot;my-test-instance&quot;, &quot;security_group&quot;: [&quot;a&quot;, &quot;b&quot;, &quot;c&quot;], &quot;spot_instance&quot;: false }
          &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
        },
        &quot;userLabels&quot;: { # Output only. A map of user-defined metadata labels.
          &quot;a_key&quot;: &quot;A String&quot;,
        },
      },
      &quot;operation&quot;: { # Additional information about a potentially long-running operation with which a log entry is associated. # Optional. Information about an operation associated with the log entry, if applicable.
        &quot;first&quot;: True or False, # Optional. Set this to True if this is the first log entry in the operation.
        &quot;id&quot;: &quot;A String&quot;, # Optional. An arbitrary operation identifier. Log entries with the same identifier are assumed to be part of the same operation.
        &quot;last&quot;: True or False, # Optional. Set this to True if this is the last log entry in the operation.
        &quot;producer&quot;: &quot;A String&quot;, # Optional. An arbitrary producer identifier. The combination of id and producer must be globally unique. Examples for producer: &quot;MyDivision.MyBigCompany.com&quot;, &quot;github.com/MyProject/MyApplication&quot;.
      },
      &quot;protoPayload&quot;: { # The log entry payload, represented as a protocol buffer. Some Google Cloud Platform services use this field for their log entry payloads.The following protocol buffer types are supported; user-defined types are not supported:&quot;type.googleapis.com/google.cloud.audit.AuditLog&quot; &quot;type.googleapis.com/google.appengine.logging.v1.RequestLog&quot;
        &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
      },
      &quot;receiveTimestamp&quot;: &quot;A String&quot;, # Output only. The time the log entry was received by Logging.
      &quot;resource&quot;: { # An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource&#x27;s schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for &quot;gce_instance&quot; has labels &quot;project_id&quot;, &quot;instance_id&quot; and &quot;zone&quot;: { &quot;type&quot;: &quot;gce_instance&quot;, &quot;labels&quot;: { &quot;project_id&quot;: &quot;my-project&quot;, &quot;instance_id&quot;: &quot;12345678901234&quot;, &quot;zone&quot;: &quot;us-central1-a&quot; }} # Required. The monitored resource that produced this log entry.Example: a log entry that reports a database error would be associated with the monitored resource designating the particular database that reported the error.
        &quot;labels&quot;: { # Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels &quot;project_id&quot;, &quot;instance_id&quot;, and &quot;zone&quot;.
          &quot;a_key&quot;: &quot;A String&quot;,
        },
        &quot;type&quot;: &quot;A String&quot;, # Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance. Some descriptors include the service name in the type; for example, the type of a Datastream stream is datastream.googleapis.com/Stream.
      },
      &quot;severity&quot;: &quot;A String&quot;, # Optional. The severity of the log entry. The default value is LogSeverity.DEFAULT.
      &quot;sourceLocation&quot;: { # Additional information about the source code location that produced the log entry. # Optional. Source code location information associated with the log entry, if any.
        &quot;file&quot;: &quot;A String&quot;, # Optional. Source file name. Depending on the runtime environment, this might be a simple name or a fully-qualified name.
        &quot;function&quot;: &quot;A String&quot;, # Optional. Human-readable name of the function or method being invoked, with optional context such as the class or package name. This information may be used in contexts such as the logs viewer, where a file and line number are less meaningful. The format can vary by language. For example: qual.if.ied.Class.method (Java), dir/package.func (Go), function (Python).
        &quot;line&quot;: &quot;A String&quot;, # Optional. Line within the source file. 1-based; 0 indicates no line number available.
      },
      &quot;spanId&quot;: &quot;A String&quot;, # Optional. The ID of the Cloud Trace (https://cloud.google.com/trace) span associated with the current operation in which the log is being written. For example, if a span has the REST resource name of &quot;projects/some-project/traces/some-trace/spans/some-span-id&quot;, then the span_id field is &quot;some-span-id&quot;.A Span (https://cloud.google.com/trace/docs/reference/v2/rest/v2/projects.traces/batchWrite#Span) represents a single operation within a trace. Whereas a trace may involve multiple different microservices running on multiple different machines, a span generally corresponds to a single logical operation being performed in a single instance of a microservice on one specific machine. Spans are the nodes within the tree that is a trace.Applications that are instrumented for tracing (https://cloud.google.com/trace/docs/setup) will generally assign a new, unique span ID on each incoming request. It is also common to create and record additional spans corresponding to internal processing elements as well as issuing requests to dependencies.The span ID is expected to be a 16-character, hexadecimal encoding of an 8-byte array and should not be zero. It should be unique within the trace and should, ideally, be generated in a manner that is uniformly random.Example values: 000000000000004a 7a2190356c3fc94b 0000f00300090021 d39223e101960076
      &quot;split&quot;: { # Additional information used to correlate multiple log entries. Used when a single LogEntry would exceed the Google Cloud Logging size limit and is split across multiple log entries. # Optional. Information indicating this LogEntry is part of a sequence of multiple log entries split from a single LogEntry.
        &quot;index&quot;: 42, # The index of this LogEntry in the sequence of split log entries. Log entries are given |index| values 0, 1, ..., n-1 for a sequence of n log entries.
        &quot;totalSplits&quot;: 42, # The total number of log entries that the original LogEntry was split into.
        &quot;uid&quot;: &quot;A String&quot;, # A globally unique identifier for all log entries in a sequence of split log entries. All log entries with the same |LogSplit.uid| are assumed to be part of the same sequence of split log entries.
      },
      &quot;textPayload&quot;: &quot;A String&quot;, # The log entry payload, represented as a Unicode string (UTF-8).
      &quot;timestamp&quot;: &quot;A String&quot;, # Optional. The time the event described by the log entry occurred. This time is used to compute the log entry&#x27;s age and to enforce the logs retention period. If this field is omitted in a new log entry, then Logging assigns it the current time. Timestamps have nanosecond accuracy, but trailing zeros in the fractional seconds might be omitted when the timestamp is displayed.Incoming log entries must have timestamps that don&#x27;t exceed the logs retention period (https://cloud.google.com/logging/quotas#logs_retention_periods) in the past, and that don&#x27;t exceed 24 hours in the future. Log entries outside those time boundaries are rejected by Logging.
      &quot;trace&quot;: &quot;A String&quot;, # Optional. The REST resource name of the trace being written to Cloud Trace (https://cloud.google.com/trace) in association with this log entry. For example, if your trace data is stored in the Cloud project &quot;my-trace-project&quot; and if the service that is creating the log entry receives a trace header that includes the trace ID &quot;12345&quot;, then the service should use &quot;projects/my-trace-project/traces/12345&quot;.The trace field provides the link between logs and traces. By using this field, you can navigate from a log entry to a trace.
      &quot;traceSampled&quot;: True or False, # Optional. The sampling decision of the span associated with the log entry at the time the log entry was created. This field corresponds to the sampled flag in the W3C trace-context specification (https://www.w3.org/TR/trace-context/#sampled-flag). A non-sampled trace value is still useful as a request correlation identifier. The default is False.
    },
  ],
  &quot;labels&quot;: { # Optional. Default labels that are added to the labels field of all log entries in entries. If a log entry already has a label with the same key as a label in this parameter, then the log entry&#x27;s label is not changed. See LogEntry.
    &quot;a_key&quot;: &quot;A String&quot;,
  },
  &quot;logName&quot;: &quot;A String&quot;, # Optional. A default log resource name that is assigned to all log entries in entries that do not specify a value for log_name: projects/[PROJECT_ID]/logs/[LOG_ID] organizations/[ORGANIZATION_ID]/logs/[LOG_ID] billingAccounts/[BILLING_ACCOUNT_ID]/logs/[LOG_ID] folders/[FOLDER_ID]/logs/[LOG_ID][LOG_ID] must be URL-encoded. For example: &quot;projects/my-project-id/logs/syslog&quot; &quot;organizations/123/logs/cloudaudit.googleapis.com%2Factivity&quot; The permission logging.logEntries.create is needed on each project, organization, billing account, or folder that is receiving new log entries, whether the resource is specified in logName or in an individual log entry.
  &quot;partialSuccess&quot;: True or False, # Optional. Whether a batch&#x27;s valid entries should be written even if some other entry failed due to a permanent error such as INVALID_ARGUMENT or PERMISSION_DENIED. If any entry failed, then the response status is the response status of one of the failed entries. The response will include error details in WriteLogEntriesPartialErrors.log_entry_errors keyed by the entries&#x27; zero-based index in the entries. Failed requests for which no entries are written will not include per-entry errors.
  &quot;resource&quot;: { # An object representing a resource that can be used for monitoring, logging, billing, or other purposes. Examples include virtual machine instances, databases, and storage devices such as disks. The type field identifies a MonitoredResourceDescriptor object that describes the resource&#x27;s schema. Information in the labels field identifies the actual resource and its attributes according to the schema. For example, a particular Compute Engine VM instance could be represented by the following object, because the MonitoredResourceDescriptor for &quot;gce_instance&quot; has labels &quot;project_id&quot;, &quot;instance_id&quot; and &quot;zone&quot;: { &quot;type&quot;: &quot;gce_instance&quot;, &quot;labels&quot;: { &quot;project_id&quot;: &quot;my-project&quot;, &quot;instance_id&quot;: &quot;12345678901234&quot;, &quot;zone&quot;: &quot;us-central1-a&quot; }} # Optional. A default monitored resource object that is assigned to all log entries in entries that do not specify a value for resource. Example: { &quot;type&quot;: &quot;gce_instance&quot;, &quot;labels&quot;: { &quot;zone&quot;: &quot;us-central1-a&quot;, &quot;instance_id&quot;: &quot;00000000000000000000&quot; }} See LogEntry.
    &quot;labels&quot;: { # Required. Values for all of the labels listed in the associated monitored resource descriptor. For example, Compute Engine VM instances use the labels &quot;project_id&quot;, &quot;instance_id&quot;, and &quot;zone&quot;.
      &quot;a_key&quot;: &quot;A String&quot;,
    },
    &quot;type&quot;: &quot;A String&quot;, # Required. The monitored resource type. This field must match the type field of a MonitoredResourceDescriptor object. For example, the type of a Compute Engine VM instance is gce_instance. Some descriptors include the service name in the type; for example, the type of a Datastream stream is datastream.googleapis.com/Stream.
  },
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Result returned from WriteLogEntries.
}</pre>
</div>

</body></html>